# makefile for raspberry pi, using help from: 
# http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/
# note that you must have PortAudio and ALSA development tools 
# installed, this can only be compiled on Linux:
# (http://www.portaudio.com/)
# adapted by James Boyle 2014
IDIR=../include

CC=gcc
CFLAGS=-I$(IDIR) -Wall -pedantic 
LIBS=-lportaudio -lasound -lrt -lpthread

OBJ=asciiboard.o asciiboard_data.o processor.o synth.o rpi/pi_main.o rpi/ascii_gyro.o rpi/pa_ringbuffer.o 
_DEPS=asciiboard.h asciiboard_const.h processor.h synth.h rpi/ascii_gyro.h rpi/pa_memorybarrier.h rpi/pa_ringbuffer.h rpi/pi_main.h
DEPS=$(patsubst %,$(IDIR)/%,$(_DEPS))

%.o: %.c $(DEPS)
	$(CC) -c -o $@ $< $(CFLAGS)

asciiboard_pi: $(OBJ)
	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)

.PHONY: clean

clean:
	rm -f *.o *~ core $(IDIR)/*~
	rm -f rpi/*.o *~ core $(IDIR)/*~ 
